 <#if authority.is(3,"1") >
<div id="div_users_add">
新增用户
<form name="users_add_form" id = "users_add_form">
<p>用户名：<input type="text" name="username"></p>
<p>姓     名：<input type="text" name="realname"></p>
<p>邮     件：<input type="text" name="email"></p>
<p>性     别：
<input type="radio" name="gender" value="0" checked>男
<input type="radio" name="gender" value="1">女
</p>
<p>电     话：<input type="text" name="phone"></p>
<p>试用结束时间：
<input class="calendar input" readonly="readonly" id="endtime" name="endtime" type="text" />

<p>状     态：
<select size="1" id="state" name="state">
    <option  selected="selected" value="0">正常</option>
    <option value="1">试用</option>
    <option value="2">注销</option>
</select>
</p>
<input type="hidden" name="scid" value="user_3">
<input type="hidden" name="roleid" id="roleid" value='' >
<input type="button" id="users_add_form_submit" value="提交"><div id="users_add_submit"></div>

<div id="div_all_role">
</form>
</div>




<script type="text/javascript">
window.addEvent('domready', function() {
		var dataURL = '/data/sc.action';
		var allroles=null;
		var allroles_pageno = 1;
		if (allroles) { allroles_pageno = allroles.findCurrentPage(); }
		new MUI.Require({
		  js: [MUI.path.plugins + 'mochaList/List.js'],
		  onload: function(){
			var dataURLParams = {"scid":"auth_1","allroles_pageno":1};//要传给dataURL的参数
			var instanceName = 'allroles';//MUI.List实例名称
			var divId = "allRole_list";//要填充的div编号
			var columns = [{text:'序号',name:'id'},{text:'角色名',name:'name'},{text:'说明',name:'note'}];//要显示的字段
			if (!allroles){
			allroles = new MUI.List({
				instanceName:instanceName,
		       	container:'div_all_role',
		       	showCheckBox:true,
				showCommand:false,
		       	id:divId,
		       	columns:columns,
		       	dataURL:dataURL,
		       	dataURLParams:dataURLParams,
		       	cbName: 'ids1',
		       	saveCheck:true,
		       	commands:[],
		       	onItemCommand: function(item,self,cmd,img) {},
		       	onItemChecked: function(item,self,cmd,img) {},
		       	onItemSelected: function(item,self,cmd,img) {},
		       	onItemColumnBound: function(item,self,col,td) {}
		   	});//MUI.List
		   	}
		   	allroles.findList(allroles_pageno);
		  }//onload
		});//MUI.Require
		
		var mainPanel = 'mainPanel';
		$('users_add_form_submit').addEvent('click', function(e){
			$('users_add_form').set('send', {
	    		url: dataURL, 
	    		onSuccess:function(responseText, responseXML){
	    			//alert(responseText);
	    			$('users_add_form_submit').set('disabled', false);
	    			$('users_add_submit').innerHTML = '';
	    			
	    			var myjson = JSON.decode(responseText);
	    			if (myjson.error.errorcode==0){
	    				MUI.notification('添加成功！');
	    				if (users) { users.goPage(1); }
	    				MUI.updateContent({
							'element':  $(mainPanel),
							'url':      '/auth/users.action',
						});
	    			}else{
	    				MUI.notification('<font color=red>错误：</font>('+myjson.error.retstring+')');
	    				
	    			}
	    		},
	    		onFailure:function(instance){
	    			MUI.notification('<font color=red>错误：</font>访问失败('+instance+')');
	    			$('users_add_form_submit').set('disabled', false);
	    			$('users_add_submit').innerHTML = '';
	    		}
			});
			$('roleid').set('value',allroles.getcurCheckIds());
			$('users_add_form_submit').set('disabled', true);
			$('users_add_submit').innerHTML = '<img src="images/spinner.gif" width="16px" height="16px">';
			$('users_add_form').send();
		});
}); //domready
</script>
<#else>
您无权访问该页面！
</#if>